//the form
<form method="POST">
    From : <input type="text" name="rating">.<br>
    To :   <input type="text" name="rating1">.<br>
    <input type="submit" name="submit" value="Search">
</form>
//dong the

<?php
$file_name = "../ptnhuan-web1/data/films.txt";

$file_path = realpath($file_name);
$films = array();

$file = fopen($file_path, "r");


//lay du lieu
while (!feof($file)){
    
    $films[] = trim(fgets($file));
}
//dong
//var_dump($films);

fclose($file);

?>

<?php foreach ($films as $line):   ?>
<?php if (!empty($line)):  ?>
<?php $films = explode(";", $line);  ?>

<img src = "../ptnhuan-web1/public/images/films/<?php echo $films[1]; ?>"> 
<?php echo $films[2] ?>
<?php echo $films[3] ?>
     <a href="edit.php">Edit</a>
<br>

<?php endif;  ?>
<?php endforeach; ?>

